<!DOCTYPE html>
<html>

    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
        <title>在线留言</title>
        <script src="/moblie/002/js/mui.min.js"></script>
        <link href="/moblie/002/css/mui.min.css" rel="stylesheet" />
        <script type="text/javascript" charset="utf-8">
            window.onload = function() {
                
                document.getElementById('yes').addEventListener('tap', function() {
                    var title = document.getElementById('title').value;
                    var tel = document.getElementById('tel').value;
                    var content = document.getElementById('content').value;
                    if (title=="" || tel=="" || content=="") {
                        alert("亲，三个选项都不能为空额！");
                        return false;
                    };
                    mui.post("{:U('Guestbook/add')}",{
                            title:title,
                            tel:tel,
                            content:content
                        },function(data){
                             //var data=JSON.parse(data);
                             alert(data.msg);
                        },'json'
                    );
                });
            }
        </script>
        <!--
        <script type="text/javascript" charset="utf-8">
            mui('form').onSubmit(function(){
                var name=$("input['name=title']");
                var tel=$("input['name=tel']");
                var content=$("input['name=content']");
                if (name=="" || tel=="" || content=="") {
                    alert("亲，三个选项都不能为空额！");
                    return false;
                };
                mui.post("{:U('Guestbook/add')}",{
                        name:name,
                        tel:tel,
                        content:content
                    },function(data){
                         alert(data.info);
                    },'json'
                );
            });
        </script>
        -->
    </head>

    <body>
        <header class="mui-bar mui-bar-nav">
            <a class="mui-icon mui-icon-home mui-pull-left" href="/m"></a>
            <a href="#popover" id="info" class="mui-icon mui-icon-bars mui-pull-right" style="padding-right: 10px;"></a>
            <h1 class="mui-title">在线留言</h1>
        </header>
        <div class="mui-content">
            <div id="popover" class="mui-popover">
                <ul class="mui-table-view">
                    <wowocms:navlist typeid='0'>
                        <li class="mui-table-view-cell"><a href="{$navlist.url}">{$navlist.name}</a>
                        </li>
                    </wowocms:navlist>
                </ul>
            </div>
            <form class="mui-input-group">
                <div class="mui-input-row">
                    <label>姓名</label>
                    <input type="text" placeholder="请输入您的姓名" name="title" id="title">
                </div>
                <div class="mui-input-row">
                    <label>电话</label>
                    <input type="text" placeholder="请输入您的联系电话" name="tel" id="tel">
                </div>
                <div class="mui-input-row" style="margin: 10px 5px;">
                    <textarea rows="5" placeholder="请输入留言" name="content" id="content"></textarea>
                </div>
                <div class="mui-button-row">
                    <button class="mui-btn mui-btn-primary" type="button" id="yes">确认</button>&nbsp;&nbsp;
                    <button class="mui-btn mui-btn-primary" onclick="return false;">取消</button>
                </div>
            </form>
        </div>
    </body>

</html>